import * as React from 'react';
//建立页面数据和store 的关联
import { connect } from 'react-redux'
import { Post, Get, Patch, Put } from '../../utils/utilHttp'
import { Link, RouteComponentProps } from 'react-router-dom';
import { Button, WhiteSpace, WingBlank,Pagination,Icon } from 'antd-mobile';
import demo from './index.js'
import '../../utils/common.scss'
import './index.scss'

import Top from '../../components/top/top'

interface IState {
}
interface IProps extends RouteComponentProps {
}
class Getstart extends React.Component<IProps, IState> {
  state = {
  }
  componentDidMount(){
    setTimeout(() => {
      demo()
    }, 500);
  }
  render() {
    let {} =this.state;
    return (
      <div className='Getstart'>
        <Top history={this.props.history}></Top>
        <div className='me_box'>
          <div className='me_main'>
            <div className='font_36'>力扣</div>
            </div>
        </div>
      </div>
    )
  }
}


//将store里面的数据映射到props 这个数据
//就是取store的数据 然后操作 赋值给页面的变量
//将页面数据和全局数据绑定
const mapState = ({ store }: any) => {
  return ({
    isLogin: store.isLogin,
    userInfo:store.userInfo
  })
}

const mapDispatch = ({ store }: any) => ({
  // changeLoaderType() {
  //   store.changeLoaderType(true)
  // }
  setPlayListAct(data:any){
    store.setPlayListAct(data)
  },
  setMp3ListAct(data:any){
    store.setMp3ListFun(data)
  },
})
//返回了 connect 其实是一个容器组件
export default connect(mapState, mapDispatch)(Getstart); 
